package com.jy.appmarket.newnetwork.http;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

import android.text.TextUtils;

public final class HttpUtils {
	public static final String urlEncode(String text) {
		if (TextUtils.isEmpty(text)) {
			return "";
		}
		String ret = "";
		try {
			ret = URLEncoder.encode(text, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			// ignore;
		}
		return ret;
	}

	public static final String urlDecode(String text) {
		if (TextUtils.isEmpty(text)) {
			return "";
		}
		String ret = "";
		try {
			ret = URLDecoder.decode(text, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			// ignore;
		}
		return ret;
	}
}